javascript understanding the strange parts